#include <bits/stdc++.h>
#define rep(i,a,b) for (int i = a; i <= b; ++ i)
#define per(i,a,b) for (int i = a; i >= b; -- i)
#define ll long long
#define INF 0x3f3f3f3f
#define llINF 0x3f3f3f3f3f3f3f3f

using namespace std;

namespace Source {
	template<typename T>
	inline T input() {
		T x = 0, f = 1;
		char c = getchar();
		while (c < '0' || c > '9') {
			if (c == '-') f = -1;
			c = getchar();
		}
		while (c <= '9' && c >= '0') {
			x = (x << 3) + (x << 1) + (c ^ 48);
			c = getchar();
		}
		return x * f;
	}

	template<int mod>
	int quickPow(int a, int b) {
		int res = 1;
		while (b) {
			if (b & 1) res = 1LL * res * a % mod;
			a = 1LL * a * a % mod;
			b >>= 1;
		}
		return res;
	}

	template<int mod>
	struct mint {
		int x;

		mint() {  }

		mint(int a) { if (a >= mod) x = a % mod;else if (a < 0) x = a + mod;else x = a; }

		mint operator + (mint b) {
			mint c = x;
			c.x += b.x;
			if (c.x >= mod) c.x -= mod;
			return c;
		}

		void operator += (mint b) { *this = *this + b; }

		mint operator * (mint b) {
			mint c = x;
			c.x = 1LL * c.x * b.x % mod;
			return c;
		}

		void operator *= (mint b) { *this = *this * b; }

		mint operator - (mint b) {
			mint c = x;
			c.x -= b.x;
			if (c.x < 0) c.x += mod;
			return c;
		}

		void operator -= (mint b) { *this = *this - b; }
	};

	template<typename T>
	struct Frac {
		T a, b;

		Frac() {  }

		Frac(T x) { a = x, b = 1; }

		Frac(T x, T y) : a(x), b(y) {  }

		void reduct() {
			T d = __gcd(a, b);
			a /= d;
			b /= d;
		}

		Frac operator + (Frac y) {
			Frac c;
			c.b = b * y.b;
			c.a = a * y.b + b * y.a;
			c.reduct();
			return c;
		}

		void operator += (Frac y) { *this = *this + y; }

		Frac operator * (Frac y) {
			Frac c;
			c.a = a * y.a;
			c.b = b * y.b;
			c.reduct();
			return c;
		}

		void operator *= (Frac y) { *this = *this * y; }

		Frac operator - (Frac y) {
			y.a = -y.a;
			return *this + y;
		}

		void operator -= (Frac y) { *this = *this - y; }

		Frac operator / (Frac y) {
			swap(y.a, y.b);
			return *this * y;
		}

		void operator /= (Frac y) { *this = *this / y; }

		bool operator < (Frac y) const { return a * y.b < b * y.a; }

		bool operator > (Frac y) const { return y < *this; }

		bool operator != (Frac y) const { return *this < y || *this > y; }

		bool operator == (Frac y) const { return !(*this != y); }

		bool operator <= (Frac y) const { return !(*this > y); }

		bool operator >= (Frac y) const { return !(*this < y); }
	};

	template<typename T, int n>
	struct Matrix {
		T a[n][n];

		T* operator [] (int x) { return a[x]; }

		Matrix(int x = 0) {
			rep (i,1,n) rep (j,1,n) a[i - 1][j - 1] = 0;
			if (x == 1) rep (i,0,n - 1) a[i][i] = 1;
			else if (x == 2) {
				a[0][0] = 1, a[0][1] = 0, a[0][2] = 0;
				a[1][0] = 1, a[1][1] = 1, a[1][2] = 0;
				a[2][0] = 1, a[2][1] = 0, a[2][2] = 1;
			}
			else if (x == 3) {
				a[0][0] = 1, a[0][1] = 1, a[0][2] = 0;
				a[1][0] = 0, a[1][1] = 1, a[1][2] = 0;
				a[2][0] = 0, a[2][1] = 1, a[2][2] = 1;
			} else if (x == 4) { a[0][2] = 1; }
		}

		Matrix operator * (Matrix b) {
			Matrix c;
			rep (i,0,n - 1) rep (j,0,n - 1) rep (k,0,n - 1) c[i][j] += a[i][k] * b[k][j];
			return c;
		}

		void operator *= (Matrix b) { *this = *this * b; }

		Matrix operator + (Matrix b) {
			Matrix c;
			rep (i,1,n) rep (j,1,n) c[i][j] = a[i][j] + b[i][j];
			return c;
		}

		void operator += (Matrix b) { *this = *this + b; }

		Matrix operator ^ (int b) {
			Matrix c(1), a = *this;
			while (b) {
				if (b & 1) c *= a;
				a *= a;
				b >>= 1;
			}
			return c;
		}

		Matrix operator ^ (ll b) {
			Matrix c(1);
			while (b) {
				if (b & 1) c *= a;
				a *= a;
				b >>= 1;
			}
			return c;
		}

		void print() {
			rep (i,0,n - 1) rep (j,0,n - 1) cerr << a[i][j].x << " \n"[j == n - 1];
		}
	};
}

int q;
multiset<int> ls, rs, sl[1000010], sr[1000010];

class segmentTree {
	private :
		struct Node {
			int tag, val;
			
			Node() {
				tag = val = 0;
			}
		}tree[4000010];
		
		inline int getLeft(int u) { return u << 1; }
		
		inline int getRight(int u) { return u << 1 | 1; }
		
		inline void pushUp(int u) { tree[u].val = max(tree[getLeft(u)].val, tree[getRight(u)].val); }
		
		inline void makeTag(int u, int k) {
			tree[u].tag += k;
			tree[u].val += k;
		}
		
		inline void pushDown(int u) {
			if (tree[u].tag) {
				makeTag(getLeft(u), tree[u].tag);
				makeTag(getRight(u), tree[u].tag);
				tree[u].tag = 0;
			}
		}
		
	public :
		void update(int u, int l, int r, int x, int y, int k) {
			if (x <= l && r <= y) {
				makeTag(u, k);
				return;
			}
			pushDown(u);
			if (x <= (l + r) / 2) update(getLeft(u), l, (l + r) / 2, x, y, k);
			if (y > (l + r) / 2) update(getRight(u), (l + r) / 2 + 1, r, x, y, k);
			pushUp(u);
		}
		
		int query() { return tree[1].val; }
}tree;

class segmentTree2 {
	private :
		struct Node {
			int maxl, minr, val;
			
			Node() {
				val = minr = INF;
				maxl = -INF;
			}
		}tree[4000010];
		
		inline int getLeft(int u) { return u << 1; }
		
		inline int getRight(int u) { return u << 1 | 1; }
		
		inline void pushUp(int u) {
			tree[u].maxl = max(tree[getLeft(u)].maxl, tree[getRight(u)].maxl);
			tree[u].minr = min(tree[getLeft(u)].minr, tree[getRight(u)].minr);
			tree[u].val = min({tree[getLeft(u)].val, tree[getRight(u)].val, tree[getRight(u)].minr - tree[getLeft(u)].maxl + 1});
//			cerr << tree[u].val << ' ' << tree[getRight(u)].minr << ' ' << tree[getLeft(u)].maxl << endl;
		}
		
	public :
		void update(int u, int l, int r, int x) {
			if (l == r) {
				tree[u].maxl = sr[l].empty() ? -INF : *sr[l].rbegin();
				tree[u].minr = sl[r].empty() ? INF : *sl[r].begin();
//				cerr << l << ' ' << tree[u].val << ' ' << tree[u].minr << ' ' << tree[u].maxl << "ATZ.\n";
//				tree[u].val = 
				return;
			}
			if (x <= (l + r) / 2) update(getLeft(u), l, (l + r) / 2, x);
			else update(getRight(u), (l + r) / 2 + 1, r, x);
			pushUp(u);
		}
		
		int query() { return tree[1].val; }
}tree1;

const int n = 1e6;
int k = 0;

void add(int l, int r) {
	++ k;
	tree.update(1, 1, n, l, r, 1);
	ls.insert(l);
	rs.insert(r);
	sl[l].insert(r);
	sr[r].insert(l);
	tree1.update(1, 1, n, l);
	tree1.update(1, 1, n, r);
}

void del(int l, int r) {
	-- k;
	tree.update(1, 1, n, l, r, -1);
	ls.erase(ls.find(l));
	rs.erase(rs.find(r));
	sl[l].erase(sl[l].find(r));
	sr[r].erase(sr[r].find(l));
	tree1.update(1, 1, n, l);
	tree1.update(1, 1, n, r);
}

int query() {
	if (k == tree.query()) {
//		cerr << "QwQ\n";
		int maxl = *ls.rbegin(), minr = *rs.begin();
		return *sl[maxl].begin() - *sr[minr].rbegin() + 1;
	}
	return tree1.query();
}

int main() {
	freopen("stone.in", "r", stdin);
	freopen("stone.out", "w", stdout);
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cin >> q;
	rep (i,1,q) {
		char op;
		int l, r;
		cin >> op >> l >> r;
		if (op == 'A') add(l, r - 1);
		else del(l, r - 1);
		cout << query() << '\n';
	}
	return 0;
}


/*
5
A 1 5
A 2 7
A 4 6
A 6 8
R 4 6
*/
